import request from '@/utils/request'

// 添加收藏
export const memberCollectPost = data => {
  return request({
    url: '/member/collect',
    method: 'post',
    data
  })
}

// 取消收藏
export const memberCollectBatch = data => {
  return request({
    url: '/member/collect/batch',
    method: 'delete',
    data
  })
}

// 获取收藏列表
export const memberCollect = params => {
  return request({
    url: '/member/collect',
    params
  })
}

// 获取我的足迹
export const memberBrowseHistory = () => {
  return request({
    url: '/member/browseHistory'
  })
}

// 删除我的足迹
export const memberBrowseHistoryBatch = data => {
  return request({
    url: '/member/browseHistory/batch',
    method: 'delete',
    data
  })
}

// 修改个人信息
export const memberProfile = data => {
  return request({
    url: '/member/profile',
    method: 'put',
    data
  })
}

// 修改头像
export const memberProfileAvatar = file => {
  return request({
    url: '/member/profile/avatar',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data' // 确保设置 Content-Type
    },
    data: file
  })
}
